Skip to content

Warm reboot: Add common warm start functions to be used by all SWSS processes#547

Merged
lguohan merged 6 commits intosonic-net:masterfrom
jipanyang:warm_reboot_collab_2
Aug 9, 2018
Merged

Warm reboot: Add common warm start functions to be used by all SWSS processes#547
lguohan merged 6 commits intosonic-net:masterfrom
jipanyang:warm_reboot_collab_2

Conversation

@jipanyang
Copy link
Copy Markdown
Contributor

Signed-off-by: Jipan Yang jipan.yang@alibaba-inc.com

What I did
Add common support functions for SWSS warm restart check, restart count and state log.
The functions are supposed to be used by all processes in SWSS docker.

Why I did it
support functions for warm restart feature.

How I verified it

admin@sonic:~$ redis-cli
127.0.0.1:6379> keys WAR*

  1. "WARM_RESTART_TABLE:neighsyncd"
  2. "WARM_RESTART_TABLE:orchagent"
  3. "WARM_RESTART_TABLE:vlanmgrd"
  4. "WARM_RESTART_TABLE:portsyncd"

127.0.0.1:6379> hgetall "WARM_RESTART_TABLE:orchagent"

  1. "restart_count"
  2. "8"
  3. "state_restored"
  4. "true"
    127.0.0.1:6379> hgetall "WARM_RESTART_TABLE:portsyncd"
  5. "restart_count"
  6. "8"

Details if related

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@jipanyang jipanyang force-pushed the warm_reboot_collab_2 branch from 859d020 to 830e91e Compare July 30, 2018 21:27
Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@jipanyang jipanyang force-pushed the warm_reboot_collab_2 branch from 830e91e to 940ee19 Compare July 30, 2018 21:34
@jipanyang jipanyang changed the title Add common warm start functions to be used by all SWSS processes Warm reboot: Add common warm start functions to be used by all SWSS processes Aug 1, 2018
Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@lguohan
Copy link
Copy Markdown
Contributor

lguohan commented Aug 3, 2018

retest this please

warmStart.enabled = false;

// Check system level warm restart config first
auto pvalue = warmStart.m_cfgRedisClient->hget(CFG_WARM_RESTART_TABLE_NAME"|system", "enable");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| should not be hard coded.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use table api?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably table should be expanded with member functions like getEntry(const std::string &key, const std::string &field) and setEntry(const std::string &key, const std::string &field, const std::string &value)

I switched to using RedisClient to avoid the clumsy key level only operations.

Will give it a try.

…ent operations

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@lguohan lguohan merged commit 8779018 into sonic-net:master Aug 9, 2018
@jipanyang jipanyang deleted the warm_reboot_collab_2 branch February 9, 2019 02:32
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…rocesses (sonic-net#547)

* Add common warm start functions to be used by all SWSS processes

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Use updated state schema

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Adapt to the new warm reboot schema

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Use the new Table::getEntry() and Table::setEntry to replace redisClient operations

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* use the new Table:hget() and Table:hset() APIs

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Add illustration about warm start knob usage

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants